/*************************************************************************
	> File Name: class.cpp
	> Author: LJM
	> Mail: ljman1101@sina.cn 
	> Created Time: 2015年01月27日 星期二 16时54分35秒
 ************************************************************************/
#include<stdlib.h>
#include<stdio.h>
#include<string.h>

#define FILE_PATH "/home/zhangxiaojun/1"
int main(int argc,char *argv[])
{
    FILE *test_fp = NULL;
    char string[1024] = {0};
    char *get_line_p = NULL;
    int i = 0;

    test_fp = fopen(argv[1], "r");
    fgets(string, 1024, test_fp);
    while (1) {
        //printf("%s\n",string);
        if (strlen(string)>1) {
            i++;
        }

       // printf("strlen = %d\n", strlen(string));
         get_line_p = fgets(string, 1024, test_fp);
         if (get_line_p == NULL) {
            break;
         }
    }   

    printf("i= %d\n",i);
    return 0;
}
